<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input type="file" name="file" id="import-file">
    <button id="import">立即导入</button>
</div>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="js/common.js"></script>
<script>
    $(document).ready(function () {
        "use strict";
        $("#import").click(function () {
            var file = $('#import-file').val();
            $.ajax({
                type: "POST",
                url: "/ebb/logistics/import",
                data: {file: file},
                contentType: 'multipart/form-data',
                mimeType: 'multipart/form-data',
                success: function (result) {
                    ShowTip("导入成功", "success", 1500);
                    setTimeout(function () {
                        window.location = "logisticsManager.html";
                    }, 2000);
                },
                error: function (err) {
                    console.log(err);
                    ShowTip("导入失败", "danger", 1500);//alert-success、.alert-info、.alert-warning、.alert-danger
                }
            });
        });
    });
</script>
</body>
</html>